/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IIncomeExpenses interface for NHibernate mapped table 'IncomeExpenses'.
	/// </summary>
	public interface IIncomeExpenses
	{
		#region Public Properties
		
		int ie_id
		{
			get ;
			set ;
			  
		}
		
		int ie_uid
		{
			get ;
			set ;
			  
		}
		
		decimal ie_money
		{
			get ;
			set ;
			  
		}
		
		byte ie_state
		{
			get ;
			set ;
			  
		}
		
		string ie_remark
		{
			get ;
			set ;
			  
		}
		
		DateTime ie_time
		{
			get ;
			set ;
			  
		}
		
		int ie_user
		{
			get ;
			set ;
			  
		}
		
		DateTime ie_addTime
		{
			get ;
			set ;
			  
		}
		
		int? ie_lastUser
		{
			get ;
			set ;
			  
		}
		
		DateTime? ie_updateTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// IncomeExpenses object for NHibernate mapped table 'IncomeExpenses'.
	/// </summary>
	[Serializable]
	public class IncomeExpenses : ICloneable,IIncomeExpenses
	{
		#region Member Variables

		protected int _ie_id;
		protected int _ie_uid;
		protected decimal _ie_money;
		protected byte _ie_state;
		protected string _ie_remark;
		protected DateTime _ie_time;
		protected int _ie_user;
		protected DateTime _ie_addtime;
		protected int? _ie_lastuser;
		protected DateTime? _ie_updatetime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public IncomeExpenses() {}
		
		public IncomeExpenses(int pieuid, decimal piemoney, byte piestate, string pieremark, DateTime pietime, int pieuser, DateTime pieaddTime, int? pielastUser, DateTime? pieupdateTime)
		{
			this._ie_uid = pieuid; 
			this._ie_money = piemoney; 
			this._ie_state = piestate; 
			this._ie_remark = pieremark; 
			this._ie_time = pietime; 
			this._ie_user = pieuser; 
			this._ie_addtime = pieaddTime; 
			this._ie_lastuser = pielastUser; 
			this._ie_updatetime = pieupdateTime; 
		}
		
		public IncomeExpenses(int pieuid, decimal piemoney, byte piestate, DateTime pietime, int pieuser, DateTime pieaddTime)
		{
			this._ie_uid = pieuid; 
			this._ie_money = piemoney; 
			this._ie_state = piestate; 
			this._ie_time = pietime; 
			this._ie_user = pieuser; 
			this._ie_addtime = pieaddTime; 
		}
		
		public IncomeExpenses(int pieid)
		{
			this._ie_id = pieid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int ie_id
		{
			get { return _ie_id; }
			set { _bIsChanged |= (_ie_id != value); _ie_id = value; }
			
		}
		
		public virtual int ie_uid
		{
			get { return _ie_uid; }
			set { _bIsChanged |= (_ie_uid != value); _ie_uid = value; }
			
		}
		
		public virtual decimal ie_money
		{
			get { return _ie_money; }
			set { _bIsChanged |= (_ie_money != value); _ie_money = value; }
			
		}
		
		public virtual byte ie_state
		{
			get { return _ie_state; }
			set { _bIsChanged |= (_ie_state != value); _ie_state = value; }
			
		}
		
		public virtual string ie_remark
		{
			get { return _ie_remark; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("ie_remark", "ie_remark value, cannot contain more than 200 characters");
			  _bIsChanged |= (_ie_remark != value); 
			  _ie_remark = value; 
			}
			
		}
		
		public virtual DateTime ie_time
		{
			get { return _ie_time; }
			set { _bIsChanged |= (_ie_time != value); _ie_time = value; }
			
		}
		
		public virtual int ie_user
		{
			get { return _ie_user; }
			set { _bIsChanged |= (_ie_user != value); _ie_user = value; }
			
		}
		
		public virtual DateTime ie_addTime
		{
			get { return _ie_addtime; }
			set { _bIsChanged |= (_ie_addtime != value); _ie_addtime = value; }
			
		}
		
		public virtual int? ie_lastUser
		{
			get { return _ie_lastuser; }
			set { _bIsChanged |= (_ie_lastuser != value); _ie_lastuser = value; }
			
		}
		
		public virtual DateTime? ie_updateTime
		{
			get { return _ie_updatetime; }
			set { _bIsChanged |= (_ie_updatetime != value); _ie_updatetime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			IncomeExpenses castObj = null;
			try
			{
				castObj = (IncomeExpenses)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._ie_id == castObj.ie_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _ie_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for IncomeExpenses 

	
	public interface IIncomeExpensesCollection : ICollection
	{
		IncomeExpenses this[int index]{	get; set; }
		void Add(IncomeExpenses pIncomeExpenses);
		void Clear();
	}
	
	[Serializable]
	public class IncomeExpensesCollection : IIncomeExpensesCollection
	{
		private IList<IncomeExpenses> _arrayInternal;

		public IncomeExpensesCollection()
		{
			_arrayInternal = new List<IncomeExpenses>();
		}
		
		public IncomeExpensesCollection( IList<IncomeExpenses> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<IncomeExpenses>();
			}
		}

		public IncomeExpenses this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((IncomeExpenses[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(IncomeExpenses pIncomeExpenses) { _arrayInternal.Add(pIncomeExpenses); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<IncomeExpenses> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
